package com.cg.big_event.validation;
import com.cg.big_event.anno.State;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
public class StateValidation implements ConstraintValidator<State,String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
        //提供校验规则
        if(value == null)
        {
            return false;
        }
        return value.equals ( "已发布" ) || value.equals ( "草稿" );
    }
}
